home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / science / vpcalc23.zip / WRITEFAC.VPC < prev   
Text File  |  1991-09-08  |  758b  |  25 lines

  1. @Echo off
  2. Rem   Start of WriteFac.VPC
  3.  
  4. Rem   This VPCalc code file tests the Write and WriteLn Procedures of VPCalc
  5. Rem   by printing a table of factorials
  6. Rem   To run, start VPCalc.Exe.  At Command: prompt, enter:
  7. Rem       ----->>>>>  Run("WriteFac  <<<<<-----;
  8. Rem   Harry Smith, 90/01/06.
  9.  
  10. Rem   procedure WriteFac;  X = N ! = 1*2*3*...*N
  11. Rem     Uses items N and Fac on the list
  12. begin:
  13.   AutoDisplay(0)
  14.   48 m  0 t  SetD(35)
  15.   WriteLn
  16.   WriteLn("Table of N Factorial ( N! = 1 * 2 * 3 * . . . * N )")
  17.   WriteLn
  18.   N = 0;  Fac = 1;
  19.   Write(N);  Write(" ! = ");  Write(Fac);  WriteLn;
  20.   Loop: N = N + 1;  Fac = Fac * N;  Write(N);  Write(" ! = "); +
  21.     Write(Fac);  WriteLn;  if N < 100  GoUpTo Loop;
  22. end:
  23.  
  24. Rem   End of WriteFac.VPC
  25.